<?php
/*
 * @FileForDetails: 来源验证器
 * @Author: zxr
 * @Date: 2022-12-10 10:26:18
 */
namespace app\crm\validate\product;

use think\Validate;

class Source extends Validate
{
    /**
     * @Descripttion: 验证规则
     * @Author: zxr
     * @Date: 2022-12-10 10:30:29
     */    
    protected $rule = [
        'name'     => "require|max:100",
        'intro'    => 'require',
        'admin_id' => 'require',
    ];

    /**
     * @Descripttion: 提示消息
     * @Author: zxr
     * @Date: 2022-12-10 10:30:29
     */ 
    protected $message = [
    ];

    /**
     * @Descripttion: 验证场景
     * @Author: zxr
     * @Date: 2022-12-10 10:30:29
     */
    protected $scene = [
        'add' => [],
        'edit' => ['name'],
    ];

    public function __construct(array $rules = array(), $message = array(), $field = array())
    {
        $this->field = [
            'name'     => '来源名称',
            'intro'    => '说明',
            'admin_id' => '创建人',
        ];

        parent::__construct($rules, $message, $field);
    }
}